
package com.insigma.business.qrcode.soldier.service.impl;



import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dao.PlacementPbNewsDao;
import com.insigma.business.qrcode.soldier.dto.PlacementPbNewsBSearcher;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import com.insigma.business.qrcode.soldier.entity.PlacementPbNewsDO;
import com.insigma.business.qrcode.soldier.service.PlacementPbNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("placementPbNewsService")
public class PlacementPbNewsServiceImpl implements PlacementPbNewsService {

    @Autowired(required = false)
    private PlacementPbNewsDao placementPbNewsDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<PlacementPbNewsDO> search(final PlacementPbNewsBSearcher placementPbNewsBSearcher) {
        return placementPbNewsDao.search(placementPbNewsBSearcher);
    }
   
    @Override
    public PlacementPbNewsDO get(final String id){
        return placementPbNewsDao.get(id);
    }

    
    @Override
    public Integer insert(final PlacementPbNewsDO placementPbNewsDO){
        placementPbNewsDO.setId(sequenceGenerator.genKey(SequenceNameConstant.PLACEMENT_PB_NEWS_ID));
        return placementPbNewsDao.insert(placementPbNewsDO);
    }

    
    @Override
    public Integer update(final PlacementPbNewsDO placementPbNewsDO){
        return placementPbNewsDao.update(placementPbNewsDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return placementPbNewsDao.delete(id,modifierType,modifierId);
    }

    @Override
    public Integer addReadCount(String id) {
        return placementPbNewsDao.addReadCount(id);
    }

    @Override
    public Integer likeOrNotNews(String id, Boolean like) {
        return placementPbNewsDao.likeOrNotNews(id, like);
    }

}
